import java.util.ArrayList;

public class User {
    private String userName;
    private String passWord;
    private int id;

    public User() {
    }

    public User(String userName, String passWord, int id) {
        this.userName = userName;
        this.passWord = passWord;
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public static void main(String[] args) {
        User s1 = new User("张三", "123456", 001);
        User s2 = new User("李四", "1234qwer", 002);
        User s3 = new User("王五", "ABCD234", 003);

        ArrayList<User> list = new ArrayList<>();
        list.add(s1);
        list.add(s2);
        list.add(s3);
        boolean flag = findId(list, 004);
        if (flag)  {
            System.out.println("找到了");
        } else {
            System.out.println("没找到");
        }

    }
    public static boolean findId(ArrayList<User> list, int id) {
        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getId() == id) {
                return true;
            }
        }
        return false;
    }
}
